package com.csc.banking.model;

// Generated Jul 11, 2014 10:43:16 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Locks generated by hbm2java
 */
@Entity
@Table(name = "Locks", catalog = "mydb")
public class Lock implements EntityObject, java.io.Serializable
{

	private Long lockId;
	private Customer customer;
	private Date dateLock;
	private static final long serialVersionUID = 1L;

	public Lock() 
	{
	}

	public Lock(Customer customer, Date dateLock) 
	{
		this.customer = customer;
		this.dateLock = dateLock;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "LockId", unique = true, nullable = false)
	public Long getLockId() 
	{
		return this.lockId;
	}

	public void setLockId(Long lockId) 
	{
		this.lockId = lockId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CustomerId", nullable = false)
	public Customer getCustomer() 
	{
		return this.customer;
	}

	public void setCustomer(Customer customer) 
	{
		this.customer = customer;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DateLock", nullable = false, length = 19)
	public Date getDateLock() 
	{
		return this.dateLock;
	}

	public void setDateLock(Date dateLock) 
	{
		this.dateLock = dateLock;
	}

}
